<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
function testRun() {
	var clientInfo = parent.document.getElementById("clientInfo").value;
	var contextPath = parent.document.getElementById("contextPath").value;
	
	var apiUrl = contextPath +"/api/" + $("#requestType").val() +"/user/duplCheck";
	
	$.ajax({
		headers : {
			"Client-Info" : clientInfo	
		},
		data : {
			"userId" : $("#userId").val()			
		},
		type : "GET",
		url : apiUrl,
		dataType : "text",
		success : function (data) {
			$("#resultField").val(data);
		},
		error : function (xhr, textStatus, thrownError) {
			$("#resultField").val("Error Status Code = " + xhr.status);			
		}
	});
}
</script>
</head>
<body>
<center><h4>아이디 중복체크 API</h4></center>
기능 : 회원가입시 아이디 중복체크 처리</br>
URL : /{requestType}/user/duplCheck</br>
Method : GET</br>
</br>
Path Variable</br>
<table border="1" cellpadding="2">
    <tr>
        <td align="right">requestType</td>
        <td><input type="text" id="requestType" style="width:200px" value="abc123"/></td>
    </tr>
</table>
<br/>
Request Parameter</br>
<table border="1" cellpadding="2">
	<tr align="center">
		<td>필드명</td>
		<td>필수여부</td>
		<td>기본값</td>
		<td>설명</td>
	</tr>
	<tr>
		<td>userId</td>
		<td align="center">Y</td>
		<td></td>
		<td>사용자 아이디</td>
	</tr>	
</table>
<br/>
<table border="0" cellspacing="0" cellpadding="2">
	<tr>
		<td align="right">userId</td>
		<td><input type="text" id="userId" style="width:200px" /></td>
	</tr>	
	<tr>
		<td align="center" colspan="2"><input type="button" value="Test" onclick="testRun();"/></td>
	</tr>	
</table>
<br/>
결과 데이터<br/>
<textarea id="resultField" style="width:450px; height:150px"></textarea>

</body>
</html>